import { request } from "../util/request.js";

export default {
    async getOne(_id) {
        return await request({
            type: "get",
            url: `/api/users/${_id}`,
        })
    },
    async updata(user) {
        return await request({
            type: "put",
            url: `/api/users/${user._id}`,
            data: user,
        })
    },
    async add(user) {
        return await request({
            type: "post",
            url: `/api/users/`,
            data: user,
        })
    },
    async del(_id) {
        return await request({
            type: "delete",
            url: `/api/users/`,
            data: { _id },
        })
    },
}